<div class="wrap">
{if $smarty.cookies.message eq NULL}
	<div id="ajaxResponse1" class="ajaxResponse"></div>
{else}
	<div id="ajaxResponse1" class="ajaxResponse fade" style="display:block">{$smarty.cookies.message}</div>
{/if}
<h2>{TranslateTag}B_LABEL_PRODUCT_MANAGEMENT{/TranslateTag}</h2>
	<p>
		<a href="?module={$smarty.get.module}&sub1={$smarty.get.sub1}&act=newproduct"><img src="../view/admin/images/object_create.png" alt="Create" /></a>
	</p>
	<table class="widefat">
		<thead>
		<tr>
			<th class="point {if $smarty.get.by eq 'desc'}sortover{else}sortoverup{/if}"  scope="col" onclick="javascript:document.location='?module=BgcmsWebshop{if $smarty.get.sub1}&sub1=product{/if}&sort=product_id&by={if $smarty.get.by eq 'desc'}asc {else}desc{/if}'">{TranslateTag}B_LABEL_ID{/TranslateTag}</th>
			<th scope="col">{TranslateTag}B_LABEL_THUMBNAIL{/TranslateTag}</th>
	        <th class="point {if $smarty.get.by eq 'desc'}sortover{else}sortoverup{/if}"  scope="col" onclick="javascript:document.location='?module=BgcmsWebshop{if $smarty.get.sub1}&sub1=product{/if}&sort=product_name&by={if $smarty.get.by eq 'desc'}asc {else}desc{/if}'">{TranslateTag}B_LABEL_PRODUCT_NAME{/TranslateTag}</th>
	        <th class="point {if $smarty.get.by eq 'desc'}sortover{else}sortoverup{/if}"  scope="col" onclick="javascript:document.location='?module=BgcmsWebshop{if $smarty.get.sub1}&sub1=product{/if}&sort=product_group_name&by={if $smarty.get.by eq 'desc'}asc {else}desc{/if}'">{TranslateTag}B_LABEL_PRODUCT_GROUP{/TranslateTag}</th>
	        <th class="point {if $smarty.get.by eq 'desc'}sortover{else}sortoverup{/if}"  scope="col" onclick="javascript:document.location='?module=BgcmsWebshop{if $smarty.get.sub1}&sub1=product{/if}&sort=product_price&by={if $smarty.get.by eq 'desc'}asc {else}desc{/if}'">{TranslateTag}B_LABEL_PRICE{/TranslateTag}</th>
	        <th colspan="2" style="text-align: center">{TranslateTag}B_LABEL_ACTION{/TranslateTag}</th>
		</tr>
		</thead>
		<tbody id="producttable">
			{foreach name=product from=$PRODUCTS.data item=item}
				<tr id="product-{$item->product_id}" class="{cycle values=,alternate}">
					<th scope='row' style='text-align: center'>{$item->product_id}</th>
					<td><img src="../upload/product/thumb/{$item->product_thumbnail}" /></td>
					<td>{$item->product_name}</td>
					<td>{$item->product_group_name}</td>
					<td>{$item->product_price} {$item->symbol_left}</td>
					<td style="text-align: center">
                    	<a href="?module={$smarty.get.module}&sub1=product&act=editproduct&id={$item->product_id}" 
							class='edit'><img src="../view/admin/images/object_edit.png" alt="Edit" />
                        </a>
                    </td>
					<td style="text-align: center">
                    	<a onclick="onDeleteProduct('?module={$smarty.get.module}&sub1=product', '{$item->product_id}', 'ajaxResponse1')" 
							class='delete'><img src="../view/admin/images/object_delete.png" alt="Delete" />
                   		</a>
                    </td>
				</tr>
			{/foreach}
		</tbody>
	</table>
    {if $PRODUCTS.data != NULL}
     <div>			
      <div style="width:300px; float:left"> 
          {TranslateTag}LABEL_PAGES{/TranslateTag} : {$PRODUCTS.TOTAL} {TranslateTag}LABEL_OF{/TranslateTag} {$PRODUCTS.TOTALDATA}
      </div>			
      <div style="text-align:right; float:right" >{$PRODUCTS.FIRST} {$PRODUCTS.PRE}&nbsp;{$PRODUCTS.LISTPAGE} {TranslateTag}LABEL_OF{/TranslateTag} &nbsp; {$PRODUCTS.TOTALPAGE} &nbsp;                   
          <select onchange="javascript:window.location='{$PRODUCTS.LINK}&{$PRODUCTS.PATHNAME}='+this.value">
            {$PRODUCTS.COMBOPAGE}                     
          </select>&nbsp;{$PRODUCTS.NEXT} {$PRODUCTS.LAST}         
      </div>
      <div style="clear:both"></div>		
    </div>	     
    {/if}
	<p>
		<a href="?module={$smarty.get.module}&sub1={$smarty.get.sub1}&act=newproduct"><img src="../view/admin/images/object_create.png" alt="Create" /></a>
	</p>
</div>